import React,{useEffect, useState}  from 'react'
import store from './store'
export default function App() {
  const [,forceUpdate]=useState()
  store.subscribe(()=>{
    console.log('---------',store.getState());
    //forceUpdate({})
 },[])
  return (
    <div>
       <h1>{store.getState()}</h1>
       <button onClick={()=>{
          store.dispatch({
            type:'add',
            payload:2
          })
       }}>派送数据</button>
    </div>
  )
}
